// pages/main/main-components/continue.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    count: 0,
    dateList: [],
    starShow: true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getWeekDates() {
      const now = new Date();
      const year = now.getFullYear();
      const month = now.getMonth() + 1;
      const day = now.getDate();
      const weekStart = new Date(year, month - 1, day - (now.getDay() || 7) + 1);
      const dateList = [];
      for (let i = 0; i < 7; i++) {
        const currentDate = new Date(weekStart.getTime());
        currentDate.setDate(weekStart.getDate() + i);
        const currentMonth = currentDate.getMonth() + 1;
        const currentDay = currentDate.getDate();
        const isToday = currentMonth === month && currentDay === day;
        const isTomorrow = currentMonth === month && currentDay === day + 1;
        const displayDate = isToday? '今天' : isTomorrow? '明天' : `${currentMonth}.${currentDay}`;
        dateList.push({
          displayDate,
          isToday,
          isTomorrow
        });
      }
      this.setData({
        dateList
      });
    },
    signUp(){
      this.starShow = false
      console.log('已点击星星')
    }
  },
  attached() {
    this.getWeekDates();
  }
})